package com.zhuss.order.db.dao.ext;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.zhuss.bean.bo.order.order.SearchOrderBo;
import com.zhuss.bean.bo.order.order.app.ListOrderBo;
import com.zhuss.bean.vo.order.order.DetailOrderVo;
import com.zhuss.bean.vo.order.order.ListOrderVo;
import com.zhuss.order.db.dao.gen.OrderMapper;
import com.zhuss.order.db.entity.Order;

/**
 * @description: 订单数据库Dao
 * @author: zhushanshuo
 * @create: Mon Jan 11 16:30:32 CST 2021
 **/

@Mapper
public interface OrderDao extends OrderMapper {
	
	void create(Order record);
	
	void delete(Order record);
	
	void refreshStatus(@Param ("orderId") Long orderId, @Param ("status") Integer status, @Param("transactionId") String transactionId, @Param("modifier") String modifier, @Param("modifierId") Long modifierId, @Param("modifyTime") Date modifyTime);
	
	void cancelBatch(@Param("orderIdList") List<Long> orderIdList, @Param("status") Integer status, @Param("modifier") String modifier, @Param("modifierId") Long modifierId, @Param("modifyTime") Date modifyTime);
	
	List<Long> listByStartAndEnd(@Param("start") Date start, @Param("end") Date end, @Param("statusList") List<Integer> statusList);
	
	List<Long> listOrderNoTop100(@Param("statusList") List<Integer> statusList, @Param("today") Date today);
	
	List<Order> listAll();

	List<Order> listById(@Param("orderIdList") List<Long> orderIdList);
	
	List<Order> listByName(@Param("name") String name);
	
	List<ListOrderVo> list(SearchOrderBo bo);
	
	Integer countList(SearchOrderBo bo);
	
	List<com.zhuss.bean.vo.order.order.app.ListOrderVo> listByApp(ListOrderBo bo);
	
	Integer countListByApp(ListOrderBo bo);
	
	DetailOrderVo detail(@Param("orderId") Long orderId);
	
}
